'''
description: 
param: 
return: 
'''
import json
from scrapy.pipelines.files import FilesPipeline


class GgglxySpiderPipeline:
    def __init__(self):
        self.file = open(r'.\result.json', 'w')

    def process_item(self, item, spider):
        content = json.dumps(dict(item), ensure_ascii=False) + "\n"
        self.file.write(content)
        return item

    def close_spider(self, spider):
        self.file.close()
